/* =========================================
   Feed Section
   ========================================= */

.feed-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 1rem;
    overflow: hidden;
}

/* Finance theme alignment fallback for feed/status/timeline tone. */
.border-red,
.border-blue {
    border-left-color: var(--primary, #FF6B00) !important;
}

.bg-red,
.bg-blue,
.dot-red,
.dot-yellow,
.dot-green,
.dot-alert,
.timeline-dot {
    background-color: var(--primary, #FF6B00) !important;
    color: #ffffff !important;
    border-color: rgba(252, 91, 8, 0.24) !important;
}

.text-red,
.text-blue,
.trend.up,
.highlight-icon,
.action-link {
    color: var(--primary, #FF6B00) !important;
}

.feed-item {
    background-color: rgba(255, 255, 255, 0.65) !important;
    border-color: rgba(102, 102, 102, 0.18) !important;
    box-shadow: none !important;
}

.feed-item:hover,
.problem-item:hover {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

.feed-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    background-color: rgba(255,255,255,0.2);
}
.feed-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.highlight-icon { color: var(--primary-orange); }

.feed-controls button {
    font-size: 0.75rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
}
.filter-link { color: #6b7280; }
.filter-link:hover { color: var(--primary-orange); }
.view-all-link { color: var(--primary-orange); }
.view-all-link:hover { text-decoration: underline; }

.feed-content {
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-item {
    background-color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    transition: background 0.3s;
}
.feed-item:hover { background-color: rgba(255,255,255,0.6); }

.border-red { border-left: 4px solid #f87171; }
.border-blue { border-left: 4px solid #60a5fa; }

.feed-main {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}
.feed-icon-box {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}
.bg-red { background-color: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.bg-blue { background-color: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }

.feed-details { width: 100%; }
.feed-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.feed-tag {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.text-red { color: #dc2626; }
.text-blue { color: #2563eb; }
.dot-alert {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #ef4444;
    animation: pulse 2s infinite;
}
.feed-time { font-size: 0.75rem; color: #9ca3af; }

.feed-details h3 { font-size: 1.125rem; font-weight: 700; color: #1f2937; }
.feed-details p { font-size: 0.875rem; color: #4b5563; margin-top: 0.25rem; }

.feed-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
}
.rec-label { font-size: 0.625rem; color: #6b7280; text-transform: uppercase; font-weight: 600; display: block; margin-bottom: 0.25rem; }
.rec-content { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; color: #1f2937; }
.action-link {
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.action-link:hover { text-decoration: underline; }

/* =========================================
   problems-panel
   ========================================= */

.problems-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.problems-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.problem-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.problem-item:hover { background-color: rgba(255,255,255,0.5); }
.problem-left { display: flex; align-items: center; gap: 0.75rem; }
.rank { font-size: 1.125rem; font-weight: 700; color: #9ca3af; width: 1rem; }
.icon-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.problem-info .title { font-size: 0.875rem; font-weight: 700; color: #1f2937; }
.problem-info .sub { font-size: 0.75rem; color: #6b7280; }
.trend { font-size: 0.75rem; font-weight: 700; }
.trend.up { color: #ef4444; }

/* =========================================
   Timeline Panel (ส่วนที่เพิ่มใหม่)
   ========================================= */
.timeline-panel {
    height: 33%; /* แบ่งความสูงให้เท่าๆ กับส่วนอื่นใน sidebar ขวา */
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.timeline-content {
    position: relative;
    padding: 1rem 1rem 1rem 2rem; /* padding-left เยอะหน่อยเผื่อที่วางเส้น */
    overflow-y: auto;
    flex: 1;
}

.timeline-line {
    position: absolute;
    left: 1.5rem; /* ตำแหน่งเส้นแนวตั้ง */
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background-color: #e5e7eb;
    z-index: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.25rem;
    padding-left: 1rem; /* ระยะห่างจากจุดไข่ปลาถึงข้อความ */
}

.timeline-dot {
    position: absolute;
    left: -1.35rem; /* ดึงจุดกลับไปทับเส้น */
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 10;
}

/* Timeline Dot Colors */
.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #facc15; }
.dot-green { background-color: #22c55e; }

.timeline-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.125rem;
}

.timeline-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
}

.timeline-desc {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.125rem;
}
